package com.inossem.warehousestorage_inossem.activity.group_up_frame;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.inossem.loadandrefresh.PullToRefreshLayout;
import com.inossem.loadandrefresh.pullableview.PullableListView;
import com.inossem.utils.listener.NoDoubleClickListener;
import com.inossem.warehousestorage_inossem.R;
import com.inossem.warehousestorage_inossem.activity.base.BaseActivity;
import com.inossem.warehousestorage_inossem.adapter.groupUpFrame.GroupUpFrameSearchMaterialAdapter;
import com.inossem.warehousestorage_inossem.utils.ActivityUtils;

/**
 * 作者：wsy on 2018/1/31 10:21
 * <p>
 * 邮箱：445979770@qq.com
 */

public class GroupUpFrameSearchMaterialActivity extends BaseActivity{
    private PullToRefreshLayout refresh;

    private PullableListView upFrameList;

    private TextView title;

    private GroupUpFrameSearchMaterialAdapter adapter;
    @Override
    protected void onCreateImpl(Bundle savedInstanceState) {
        super.onCreateImpl(savedInstanceState);
        setContentView(R.layout.activity_group_up_frame_search_material);
        initView(GroupUpFrameSearchMaterialActivity.this);
        initData(GroupUpFrameSearchMaterialActivity.this);

    }
    private void initView(Activity activity){
        upFrameList = (PullableListView) activity.findViewById(R.id.upFrameList);
        refresh = (PullToRefreshLayout) activity.findViewById(R.id.upFrameRefresh);
        title = (TextView) activity.findViewById(R.id.headerTitle);
    }
    private void initData(Activity activity) {
        title.setText(R.string.activity_group_up_frame_overview_group_material);
        ActivityUtils.initBackAndFunction(activity, R.string.activity_in_storage_receive_list_title_short, new NoDoubleClickListener() {
            @Override
            public void onNoDoubleClick(View v) {
                finish();
            }
        });
        addUpFrameListData(true);
    }
    private void addUpFrameListData(boolean flag){
        if (flag) {
            adapter = new GroupUpFrameSearchMaterialAdapter(GroupUpFrameSearchMaterialActivity.this , "");
            upFrameList.setAdapter(adapter);
        }
    }
}
